<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <script type = "text/javascript" src="../scripts/validationScript.js"></script>
    </head>
    <body>
        <?php
        // put your code here
        $sesUserId = 1;
        $strFirstName = NULL;
        $strMiddleName = NULL;
        $strLastName = NULL;
        $intAuthorID = $_GET['id'];
        require '..\lib\dbConnection.php';
        
        if($dbHandler)
        {
			
            $authorDataSet = mysql_query("SELECT ID,FirstName, MiddleName, LastName FROM ref_authors WHERE ID = ".$intAuthorID." AND RecordStatus = 'ACTIVE'", $dbConnection);
            while ($dataRow = mysql_fetch_array($authorDataSet))
                        {
                            $strFirstName = $dataRow["FirstName"];
                            $strMiddleName = $dataRow["MiddleName"];
                            $strLastName = $dataRow["LastName"];
                        }
            }
        ?>
        
                <form name="frm_editAuthor" method="post" action="ref_editAuthorHandler.php" onsubmit="return validateAuthor('frm_editAuthor','txtAuthorFirstName','txtAuthorLastName');">
          <table width="75%" border="1" align="center" cellpadding="2" cellspacing="2">
            <tr>
              <td>&nbsp;</td>
              <td>
                  <input type="hidden" name="intUserID" id="intUserID" value="<?php echo $sesUserId; ?>"></input>
                  <input type="hidden" name="intAuthorID" id="intAuthorID" value="<?php echo $intAuthorID; ?>"></input>
              </td>
            </tr>
            <tr>
              <td>First Name</td>
              <td><label>
                <input type="text" name="txtAuthorFirstName" id="txtAuthorFirstName" value="<?php echo $strFirstName; ?>" size="50">
              </label></td>
            </tr>
            <tr>
              <td>Middle Name</td>
              <td><label>
                <input name="txtAuthorMiddleName" type="text" id="txtAuthorMiddleName" value="<?php echo $strMiddleName; ?>" size="50">
              </label></td>
            </tr>
            <tr>
              <td>Last Name</td>
              <td><label>
                <input name="txtAuthorLastName" type="text" id="txtAuthorLastName" value="<?php echo $strLastName; ?>" size="50">
              </label></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><label>
                <input type="submit" name="addAuthor" id="addAuthor" value="Submit">
              </label></td>
            </tr>
          </table>
    </form>
    <?php
        mysql_close($dbConnection);
    ?>
    </body>
</html>
